var t = getApp();

Component({
    properties: {
        area: {
            type: String
        },
        show: {
            type: Boolean
        },
        isEdit: {
            type: Boolean
        }
    },
    data: {
        isHidden: !0,
        cooperatePrice: "",
        marketPrice: ""
    },
    methods: {
        hideDialog: function() {
            this.setData({
                isHidden: !0
            });
        },
        showDialog: function(t, e) {
            this.setData({
                isHidden: !1,
                cooperatePrice: e,
                marketPrice: t
            });
        },
        _inputCooperate: function(t) {
            var e = t.detail.value;
            this.setData({
                cooperatePrice: e
            });
        },
        _inputMarket: function(t) {
            var e = t.detail.value;
            this.setData({
                marketPrice: e
            });
        },
        _cancel: function() {
            this.triggerEvent("cancel");
        },
        _clickOk: function() {
            var e = parseInt(this.data.marketPrice), i = parseInt(this.data.cooperatePrice);
            t.util.isNumber(e) ? t.util.isNumber(i) ? e < 100 || e > 1e5 ? t.util.showToast("市场价区间为100～100000") : i < 100 || i > 1e5 ? t.util.showToast("合作价区间为100～100000") : i > e ? t.util.showToast("合作价应该低于市场价") : this.triggerEvent("ok", {
                marketPrice: this.data.marketPrice,
                cooperatePrice: this.data.cooperatePrice
            }) : t.util.showToast("合作价只能为纯数字") : t.util.showToast("市场价只能为纯数字");
        }
    }
});